package Stack;

import org.junit.Test;

import java.math.BigDecimal;

/**
 * @author yyq
 * @create 2021-10-08 17:08
 */
public class test {
    @Test
    public void test12(){
        String test="(3+4)*5-6";
        StackComputer<Character> computer=new StackComputer<Character>(100);
        computer.init(test);
////        BigDecimal bigDecimal = computer.cumpteStack();
//        System.out.println(bigDecimal);

    }
    @Test
    public void test1(){
        String test="(3+4)*5-6";
        ArrayStack_cc<Character> stack_cc=new ArrayStack_cc(20);
        for (int i = 0; i < test.length(); i++) {
            int end=0;
            if(i==test.length()-1) end=-1;
            stack_cc.push(test.charAt(i),end);
        }
        int length=stack_cc.getTop();
        for (int i = 0; i < length; i++) {
            System.out.println(stack_cc.pop());
        }

    }

    @Test
    public void testLinkStack(){
        Stack<Integer> stack = new Stack<Integer>();
        stack.push(1);
        stack.push(2);
        while (!stack.isEmpty()){
            System.out.println(stack.pop());
        }

    }

    public static void main(String[] args) {
        ArrayStack<Integer> stack= new ArrayStack<Integer>(10);
        stack.push(1);
        stack.push(2);
        while(!stack.isEmpty()){
            System.out.println(stack.pop());
        }

    }
}
